<?php
/*
 * class PubCtl
 */

class HomeCtl  {
	
	function index(){
		//echo 'helloworld';
		//$hi=N_('Hello');
		//F_('Hello');
		//$cache=APP::AD('cache');
		//var_dump($cache);
		//var_dump(serialize(array(6,5)));
		//$cache->set('a',array(10),100);
		//$cache->set(array('e'=>array(10),'f'=>array(10,$cache)));
		
		//var_dump($cache->get('a'));
		//var_dump($cache->get(array('e','f')));
		//$cache->set('a',10);
		//$cache->set('b',20);
		//$cache->dec(array('a'=>10,'b'=>20));
		//var_dump($cache->set('a',10));
		//var_dump($cache->get('a'));
		//var_dump($cache->getInfo('ServerStatus','127.0.0.1',11211));
		//$oa=new OAuth($args);
		//$oa=APP::N

		$args=array('appKey'=>'1835816085',
			    'appSecret'=>'7f4fa8d6461ad52421ed0362fcbe0c39',
			    'signMethod'=>'HMAC-SHA1'
			    //'isWeb'=>TRUE,
			    //'defaultCallbackUrl'=>'http://www.baidu.com'
			    );
		$oa=N('weibo',$args);//其他的N方法也需要改造参数问题
		//var_dump($oa);
		$oa->getRequestToken();
		//var_dump($oa);
		print($oa->getAuthorizeURL('page','http://127.0.0.1/libs/php/ctphp/?m=home.hello'));
		
		//$args=array('appKey'=>'203642',
		//	    'appSecret'=>'24ffe002672412db74ad41867ec97f49'
		//	    );
		//$oa=N('qzone',$args);//其他的N方法也需要改造参数问题
		////var_dump($oa);
		//$oa->getRequestToken();
		//var_dump($oa);
		//print($oa->getAuthorizeURL('page','http://127.0.0.1/libs/php/ctphp/?m=home.hello'));
		
		
		//$c=APP::ADP('http');
		//$cookie='U_TRS1=705a9318.35a642ad.4d9c8f15.fd0c96fc;
		//UOR=,t,;
		//SINAGLOBAL=112.90.147.30.267881302180583405;
		//WBUP=12300;
		//ALF=1302983480;
		//SUR=uid%3D1717305901%26user%3Dcokeetang%2540gmail.com%26nick%3Dcokeetang%26email%3D%26dob%3D%26ag%3D4%26sex%3D%26ssl%3D0;
		//un=cokeetang@gmail.com;
		//SGUP=0;
		//U_TRS2=0000008d.e8bd379c.4da44508.4b34766d;
		//SUE=es%3D88df625ab32a775ed437b5e5c745af07%26ev%3Dv1%26es2%3Dd3f77378ce688bc32d8b61ec4a8505a7%26rs0%3D5cL%252B%252Ff1%252BTwp7OtpyojMcrsBGt%252BNXHnY4RQJWeQWVAHtAm9c7i3%252ByLQEHGInRf5wRprHUvFbqNEjWamA0IqV%252FiM2wsulfRjMcZU8f0SvbRXS3YEJqInOuNwSagOjG8402EVPIzGFi7JKlG4rXgotnQyIYC5trOygNh%252BXeVzlbXr0%253D%26rv%3D0; SUP=cv%3D1%26bt%3D1302611207%26et%3D1302697607%26lt%3D7%26uid%3D1717305901%26user%3Dcokeetang%2540gmail.com%26ag%3D4%26name%3Dcokeetang%2540gmail.com%26nick%3Dcokeetang%26sex%3D%26ps%3D0%26email%3Dcokeetang%2540gmail.com%26dob%3D%26ln%3D%26os%3D;
		//_s_tentry=login.sina.com.cn;
		//Apache=112.90.147.22.505371302611218243;
		//ULV=1302697619845:8:8:4:112.90.147.22.505371302611218243:1302539734156;
		//_s_upa=8';
		////Content-Type:multipart/form-data; boundary=----WebKitFormBoundary0ncQnB7h4PJAt2D4
		//$c->init('http://picupload.t.sina.com.cn/interface/pic_upload.php?marks=1&markstr=weibo.com%2Fcokeetang&s=rdxt&app=miniblog&cb=http://t.sina.com');
		//$c->set(array('cookie'=>$cookie));
		//$ret=$c->upload('image.jpg','pic1');
		//var_dump($ret);
	}
	
	function image(){
		$img=APP::ADP('image','gd');
		//var_dump($img->getInfo());
		//var_dump(get_include_path());
		//var_dump($img->getimageInfo('d:\tmp\Screenshot.png',array('mime','type')));
		//var_dump($img->getThumbnail('d:\tmp\input.jpg'));
		$img->imageConversion('d:\tmp\input.jpg','image/vnd.wap.wbmp',TRUE);
	}
	
	function hello(){
		
		//var_dump($pb);
		//$pb->createCls('hello');
		//$b=new Book();
		//$pb=N('PB','hello');
		//$pb->createCls();
		
		//$b=$pb->cls('Book');
		//$b->set_nbsp('hello');
		////
		//$s=$pb->cls('Books');
		//$s->add_b();
		//$s->set_b(0,$b);
		//$a=$pb->serialize($s);
		////
		////
		//$s=$pb->cls('Books');
		//$e=$pb->unserialize($a,'Books');
		////
		////
		//$book=$e->b(0);
		//var_dump($book->nbsp());

		
		//DS('common/xweibo.index');
		//TPL::assign('data',array('a'=>10));
		//TPL::display('home.hello');
		$args=array('appKey'=>'1835816085',
			    'appSecret'=>'7f4fa8d6461ad52421ed0362fcbe0c39',
			    'signMethod'=>'HMAC-SHA1'
			    //'isWeb'=>TRUE,
			    //'defaultCallbackUrl'=>'http://www.baidu.com'
			    );
		$oa=N('weibo',$args);//其他的N方法也需要改造参数问题
		
		$oa->getAuthorizeCallBackOAuth();
		////$abc=array('10');
		////echo getVarName($abc);
		$oa->getAccessToken();
		
		//var_dump($oa);
//<<<<<<< .mine
		//var_dump($oa->update('addsdsdsddaa',NULL,NULL,array(10,10)));//不支持中文
		//$ret=$oa->getFriends(NULL,'cokeetang',-1,2);
		//$ret=$oa->getAllFrineds(NULL,'cokeetang');
		//$ret2=$oa->getAllFollowers(NULL,'cokeetang');
		$a=$oa->getUserShow(NULL,'selina');
		$ret=$oa->parseProfileImage($a['profile_image_url'],TYPE_IMG_180);
		var_dump($ret);
		//var_dump(count($ret['users']),count($ret2['users']));
//=======
		//var_dump($oa->update('addd33aaeeedeffgg',NULL,NULL,array(10,10)));//不支持中文
//>>>>>>> .r21
		//var_dump($oa->getUserList($_SESSION['user_id'],1));
		//var_dump($oa->createUserList($_SESSION['user_id'],'hello7',1));
		//var_dump($oa->upload_pic('image.jpg'));
		
		//  public 'oauth_token_access' => string '1e225c72d3397588f89dd565e14fabfc' (length=32)
		//public 'oauth_token_secret_access' => string '417d7af05eef63a48210426c68b16acf' (length=32)
		//页面重定向
		
		//var_dump($oa);
		
	}
	
}
?>